package com.ruoyi.web.controller.train;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.train.domain.JyTrainingSchoolStaffDetail;
import com.ruoyi.train.service.IJyTrainingSchoolStaffDetailService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 培训学校员工信息Controller
 *
 * @author aulbrother
 * @date 2024-04-06
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/train/staff/detail")
public class JyTrainingSchoolStaffDetailController extends BaseController {
    private final IJyTrainingSchoolStaffDetailService jyTrainingSchoolStaffDetailService;

    /**
     * 查询培训学校员工信息列表
     */
    @GetMapping("/list")
    public TableDataInfo list(JyTrainingSchoolStaffDetail jyTrainingSchoolStaffDetail) {
        startPage();
        List<JyTrainingSchoolStaffDetail> list = jyTrainingSchoolStaffDetailService.selectJyTrainingSchoolStaffDetailList(jyTrainingSchoolStaffDetail);
        return getDataTable(list);
    }

    /**
     * 获取培训学校员工信息详细信息
     */
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return success(jyTrainingSchoolStaffDetailService.selectJyTrainingSchoolStaffDetailById(id));
    }
}
